<template>
<div class="child">
    <h3>我是儿子</h3>
    <p>祖先给我的钱：{{ money }}</p>
</div>
</template>

<script setup>
    import { inject } from 'vue';

    const money = inject('qian')
</script>

<style scoped>
.child{
    padding: 20px;
    background-color: blueviolet;
}
</style>